{% extends 'base.html' %}

{% block page-main %}
    <div class="container-fluid">
        <div class="row">
            {% include 'manage_nav.html' %}
            <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
                <h1 class="page-header">编辑文章</h1>

                <div class="panel panel-primary">
                    <!-- Default panel contents -->
                    <div class="panel-heading">编辑文章</div>
                    <div class="panel-body">
                        <form class="form-horizontal" method="post" action="" novalidate>
                            {% csrf_token %}
                            {% for field in form_obj %}
                                <div class="form-group {% if field.errors %}has-error{% endif %}">
                                    <label for="{{ field.id_for_label }}"
                                           class="col-sm-2 control-label">{{ field.label }}</label>
                                    <div class="col-sm-8">
                                        {{ field }}
                                        <span class="help-block"> {{ field.errors.0 }} </span>

                                    </div>
                                </div>
                            {% endfor %}

                            <div class="form-group">
                                <label for="detail"
                                       class="col-sm-2 control-label">文章详情</label>
                                <div class="col-sm-8">
                                    {{ article_detail_form_obj.content }}
                                </div>
                            </div>

                            <div class="form-group">
                                <div class="col-sm-offset-2 col-sm-10">
                                    <button type="submit" class="btn btn-default">保存</button>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
{% endblock %}